<!DOCTYPE html>
<html>
  <head>
    <title>webpage for service-worker-repeat-fetch</title>
    <script>
    async function installSWAndWaitForActivated() {
        const reg = await navigator.serviceWorker.register(
            'service-worker-repeat-fetch.js');
        const worker = reg.installing || reg.waiting || reg.active;
        if (worker.state === 'activated')
            return;
        return new Promise(resolve => {
            worker.addEventListener('statechange', () => {
                if (worker.state === 'activated')
                    resolve();
            });
        });
    }
    </script>
  </head>
</html>
